<?php
if( $action == 'view')
{
    echo $this->get_tag("form", array("class" => "app_form"));
    echo $this->callElement("default/tools/tool_bar",array("buttons"=>array( array("type"=>"back")) ,"title" => "Account Information")); 
    
    if( $message != ''){ echo $this->callElement('default/tools/message', array('caption' =>'Message','type' => 'success', 'message' => $message));}
    
    $data_list_arr= array
                    (
                        array("title" => "First Name","value" => $member_info['f_name']),
                        array("title" => "Last Name","value" => $member_info['l_name']),
                        array("title" => "Email","value" => $member_info['email']),
                        array("title" => "Phone No","value" => $member_info['phone_no']),
                        array("title" => "Address","value" => $member_info['address']),
                        array("title" => "State","value" => $member_info['state']),
                        array("title" => "Zipcode","value" => $member_info['zipcode']),
                        array("title" => "Country","value" => $member_info['country']),
                        array("title" => "Date Signup","value" => App::Load("Helper/Date")->dateFormated($member_info['signup_date'])),		
                    );

    echo $this->callElement('default/tools/column_listing',	array( 'title' =>'User Information',"listing_data" => $data_list_arr));

    echo $this->callElement("default/tools/tool_bar",array("buttons"=>array(array("type"=>"back")) ,"title" => NULL)); 
    echo $this->get_tag("/form");
}
else if ($action=='edit')
{
    /*
     * Set data validation fields
     */
    $validation_map = array(
                             "f_name" => "NULL",
                             "l_name" => "NULL"
                             );
    /*
     * Calling validation
     */
    echo $this->validation_map($validation_map,array('error_background'=>ERROR_BACKGROUND,'default_background'=>'#FFFFFF','from_name'=>'#member_update_form','auto_submit'=>'true'));

    echo $this->get_tag("form", array("class" => "app_form",'id'=>'member_update_form',"method"=>"post","action"=>$this->baseurl("/member/account")));
    echo App::Load("Helper/Html")->hiddenTag("data[Member][id]",$member_info['id']);
    echo $this->callElement("default/tools/tool_bar",array("buttons"=>array( array("type"=>"back"),array("type"=>"save")) ,"title" => "Account Information")); 
    $data_list_arr= array
                    (
                        array("title" => "First Name","value" => App::Load("Helper/Html")->inputTag("data[Member][f_name]",$member_info['f_name'],array("id"=>"f_name","class"=>"app_input"))),
                        array("title" => "Last Name","value" => App::Load("Helper/Html")->inputTag("data[Member][l_name]",$member_info['l_name'],array("id"=>"l_name","class"=>"app_input"))),
                        array("title" => "Phone No","value" => App::Load("Helper/Html")->inputTag("data[Member][phone_no]",$member_info['phone_no'],array("class"=>"app_input"))),
                        array("title" => "Address","value" => App::Load("Helper/Html")->textareaTag("data[Member][address]",$member_info['address'],array("class"=>"app_input"))),
                        array("title" => "State","value" => App::Load("Helper/Html")->inputTag("data[Member][state]",$member_info['state'],array("class"=>"app_input"))),
                        array("title" => "Zipcode","value" => App::Load("Helper/Html")->inputTag("data[Member][zipcode]",$member_info['zipcode'],array("class"=>"app_input"))),
                        array("title" => "Country","value" => App::Load("Helper/Html")->countryTag("data[Member][country]",$member_info['country'],array('id' => 'country')))
                    );
    echo $this->callElement('default/tools/form_listing',	array("listing_data" => $data_list_arr));
    echo $this->callElement("default/tools/tool_bar",array("buttons"=>array( array("type"=>"back"),array("type"=>"save")) ,"title" => NULL)); 
    echo $this->get_tag("/form");
}
?>